package day06.homework.extend;

import java.util.Random;

/**
 * 定义一个printArrayData()，用于输出整型数组的每一个元素的值，测试方法
 */
public class Two {
    public static void main(String[] args) {
        int[] arr1 = new int[5];// 0,0,0,0,0
        int[] arr2 = {2,4,6,8,9};
        int[] arr3 = new int[]{1,3,5,7,9};

        printArrayData(arr1);
        printArrayData(arr2);
        printArrayData(arr3);

        int[] arr4 = new int[5];
        Random rand = new Random();
        for (int i = 0; i < arr4.length; i++) {
            arr4[i] = rand.nextInt(100)+1;
        }
        printArrayData(arr4);

    }

    public static void printArrayData(int[] arr){
        for (int i=0;i<arr.length;i++){
            System.out.print(arr[i]+"\t");
        }
        System.out.println();
    }








}
